package org.aristotle.demo.model.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

@Data
@ApiModel("图书")
@TableName("tb_book")
public class Book {

    @ApiModelProperty("图书id")
    @TableId(value = "id", type = IdType.AUTO)
    @JSONField(name = "id")
    private java.lang.Long id;

    @ApiModelProperty("图书名")
    @JSONField(name = "title")
    private java.lang.String title;

    @ApiModelProperty("图书信息")
    @JSONField(name = "info")
    private java.lang.String info;

    @ApiModelProperty("创建时间")
    @JSONField(name = "createTime",format = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT)
    private java.util.Date createTime;

    @ApiModelProperty("修改时间")
    @JSONField(name = "updateTime",format = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private java.util.Date updateTime;

    @ApiModelProperty("分类id")
    @JSONField(name = "categoryId")
    private java.lang.Long categoryId;

    @TableLogic
    @ApiModelProperty("逻辑删除")
    @JSONField(serialize = false)
    @TableField(fill = FieldFill.INSERT)
    private java.lang.Integer deleted;

}
